from django.contrib import admin

from .models import Tool, Platform, Group, Project, Webhook

class TooLAdmin(admin.ModelAdmin):
    list_display = ['id','name', 'url']

class PlatformAdmin(admin.ModelAdmin):
    list_display = ['id','name']

class GroupAdmin(admin.ModelAdmin):
    list_display = ['id','name', 'platform']

class ProjectAdmin(admin.ModelAdmin):
    list_display = ['id','name']

class WebhookAdmin(admin.ModelAdmin):
    list_display = ['id','name','project', 'tool', 'uuid']
    readonly_fields =['uuid']
    change_form_template = 'add_form.html'

# Register your models here.
admin.site.register(Tool, TooLAdmin)
admin.site.register(Platform, PlatformAdmin)
admin.site.register(Group, GroupAdmin)
admin.site.register(Project, ProjectAdmin)
admin.site.register(Webhook, WebhookAdmin)